<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib uri="http://shiro.apache.org/tags" prefix="shiro" %>
<c:set var="contextPath" value="${pageContext.request.contextPath}"></c:set>


<title>加盟店 - 店铺列表</title>
<meta name="viewport"
	content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<meta http-equiv="X-UA-Compatible" content="ie=edge" />
<link rel="stylesheet" href="${contextPath}/static/ace/components/_mod/jquery-ui/jquery-ui.css" />
<link rel="stylesheet" href="${contextPath}/static/ace/components/bootstrap-datepicker/dist/css/bootstrap-datepicker3.css" />
<link rel="stylesheet" href="${contextPath}/static/ace/components/_mod/jqgrid/ui.jqgrid.css" />
<%--<jsp:include page="../../head.jsp"/>--%>
<script src="${contextPath}/static/statistics/js/vue.js"></script>
<script src="${contextPath}/static/countjs/regularYz.js"></script>
<script src="${contextPath}/static/franchisee/form.js"></script>
<link href="${contextPath}/static/ztree/css/zTreeStyle.css" rel="stylesheet" />


<style type="text/css">
	body {
		overflow:-Scroll;
		overflow-x:hidden;
	}
	.customBtn {
		line-height: 20px;
	    margin-bottom: 3px;
	}
	.btnLine {
		margin-left: 1px; 
		margin-top: 8px;
		margin-bottom: 2px;
	}

	.autocomplete-suggestions {
		border: 1px solid #999;
		background: #FFF;
		overflow: auto;
	}

	.autocomplete-suggestion {
		padding: 2px 5px;
		white-space: nowrap;
		overflow: hidden;
	}

	.autocomplete-selected {
		background: #F0F0F0;
	}

	.autocomplete-suggestions strong {
		font-weight: normal;
		color: #3399FF;
	}

	@-moz-document url-prefix() {
		fieldset {
			display: table-cell;
		}
	}	

table tr td input {
	font-weight: normal;
}


table input[type=checkbox] {
	vertical-align: middle;
}
table input[disabled]{color:red;opacity:1}
</style>

<div id="app" class="row">
	<div class="row btnLine" >
		<div class="button-len col-sm-12">
			<%--<select id="stateInput" class="hide">
				<option value="-1">==审核状态==</option>
				<option value="3">待审核</option>
				<option value="1">通过</option>
				<option value="4">拒绝</option>
				<option value="0">无效</option>
			</select>--%>
			<form class="form-inline">
				<!-- <button type="button" class="btn btn-white btn-sm btn-purple customBtn" id="" onclick="addCargoShop()">
					<i class="ace-icon fa fa-plus-circle purple"></i> 新增
				</button> -->
				<%--<shiro:hasPermission name="CLOUDERPSHOP:AUDIT">--%>
					<button type="button" class="btn btn-white btn-info btn-sm customBtn" id="editgoShop">
						<i class="ace-icon fa fa-pencil blue"></i> 加盟店铺审批
					</button>
				<%--</shiro:hasPermission>--%>
				<!-- <button type="button" class="btn btn-white btn-info btn-sm customBtn" id="editShop">
					<i class="ace-icon fa fa-pencil blue"></i> 状态审核
				</button> -->
				
				<!-- <label style="">店铺类型</label>
				<select class="input-sm" id="shopType1" style="width: 85px; text-align: center">
					<option value=""> == 全部 == </option>
					<option value="直营"> == 直营 == </option>
					<option value="加盟"> == 加盟 == </option>
					<option value="仓库"> == 仓库 == </option>
				</select> -->
				<!-- <label style="">状态</label>
				<select id="state" class="" style="width: 96px; text-align: center">
					<option value=""> == 全部 == </option>
					<option value="-1"> == 待审 == </option>
					<option value="1"> == 通过 == </option>
					<option value="4"> == 拒绝 == </option>
					<option value="0"> == 无效 == </option>
					<option value="5"> == 经营 == </option>
					<option value="6"> == 注销 == </option>
					<option value="7"> == 歇业 == </option>
				</select> -->

				<!-- <div class="form-group">
					<input class="form-control input-sm" type="text" id="shopNameInp" style=""
						   placeholder="店铺名称">
				</div> -->
				<!-- <button type="button" class="btn btn-sm btn-white btn-info search-len customBtn"
						onclick="searchShop()">
					<i class="ace-icon fa fa-search orange"></i>搜索
				</button> -->
			</form>
		</div>
	</div>
	
	<div class="col-xs-12">

		<table id="grid-table"></table>

		<div id="grid-pager"></div>

	</div>


	<!-- 新增修改数型内容 -->
	<div id="authorizationInfoContentShop" class="hide">
		<div class="content_wrap" id="treeDemoShop">
			<div class="zTreeDemoBackgroundShop left" style="width: 600px; margin-left: 23px;">
				<form id="audit6Form">
					<!-- <div class="row">
						<button class="btn btn-white btn-info btn-sm customBtn btn-xs" type="button" v-on:click="tableShow">基础信息</button>
						<button class="btn btn-white btn-info btn-sm customBtn btn-xs" type="button" v-on:click="businessLicenseShow">营业执照</button>
						<button class="btn btn-white btn-info btn-sm customBtn btn-xs" type="button" v-on:click="licenceShow">许可证</button>
					</div> -->

					<div class="row" id="tableDiv">
						<div style="background-color:gray; font-weight: bold;">基础资料</div>
						<table style="width: 100%;font-size: 12px;border-collapse: collapse;">
							<tr style="text-align: center;border: 1px solid gray;font-weight: bold;">
								<td style="text-align: center;border: 1px solid gray;">姓名</td>
								<td style="border: 1px solid gray;">
									<input type="text" id="BASE_NAME" name="BASE_NAME" readonly  style="border: 0px; margin: 0px; width:100%; height:8px;" />
								</td>
								<td style="text-align: center;border: 1px solid gray;">性别</td>
								<td style="font-weight: normal;border: 1px solid gray;" > 
									<input type="text" id="BAES_SEX" name="BAES_SEX" readonly style="border: 0px; margin: 0px; width:100%; height:8px;" />
								</td>
							</tr>
							<tr style="text-align: center;border: 1px solid gray;font-weight: bold;">
								<td style="border: 1px solid gray;">年龄</td>
								<td style="border: 1px solid gray;">
									<input type="text" id="BASE_AGE" name="BASE_AGE" readonly style="border: 0px; margin: 0px; width:100%; height:8px;" />
								</td>
								<td style="border: 1px solid gray;">学历</td>
								<td style="border: 1px solid gray;">
									<input type="text" id="BASE_EDUCATION" name="BASE_EDUCATION" readonly style="border: 0px; margin: 0px; width:100%; height:8px;" />
								</td>
							</tr>
							<tr style="text-align: center;border: 1px solid gray;font-weight: bold;">
								<td style="border: 1px solid gray;">身份证号</td>
								<td style="border: 1px solid gray;"><input type="text" id="BASE_ID_CARD_NO" name="BASE_ID_CARD_NO" readonly style="border: 0px; margin: 0px; width:100%; height:8px;" /></td>
								<td style="border: 1px solid gray;">联系电话</td>
								<td style="border: 1px solid gray;"><input type="text" id="BASE_CONTACT_NUMBER" name="BASE_CONTACT_NUMBER" readonly style="border: 0px; margin: 0px; width:100%; height:8px;" /></td>
							</tr>
							<tr style="text-align: center;border: 1px solid gray;font-weight: bold;">
								<td style="border: 1px solid gray;">手机号码</td>
								<td style="border: 1px solid gray;"><input type="text" id="BASE_PHONE_NUMBER" name="BASE_PHONE_NUMBER" readonly style="border: 0px; margin: 0px; width:100%; height:8px;" /></td>
								<td style="border: 1px solid gray;">邮箱</td>
								<td style="border: 1px solid gray;"><input type="text" id="BASE_EMAIL" name="BASE_EMAIL" readonly style="border: 0px; margin: 0px; width:100%; height:8px;" /></td>
							</tr>
							<tr style="text-align: center;border: 1px solid gray;font-weight: bold;">
								<td style="border: 1px solid gray;">现行职业</td>
								<td style="border: 1px solid gray;"><input type="text" id="BASE_JOB" name="BASE_JOB" readonly style="border: 0px; margin: 0px; width:100%; height:8px;" /></td>
								<td style="border: 1px solid gray;">从事时间</td>
								<td style="border: 1px solid gray;"><input type="text" id="BASE_WORK_TIME" name="BASE_WORK_TIME" readonly style="border: 0px; margin: 0px; width:100%; height:8px;" /></td>
							</tr>
							<tr style="text-align: center;border: 1px solid gray;font-weight: bold;">
								<td style="text-align: center;border: 1px solid gray;font-weight: bold;">加盟主体</td>
								<td colspan="3" style="font-weight: normal;border: 1px solid gray;">
									<input type="text" id="BASE_JOIN_BODY" name="BASE_JOIN_BODY" readonly style="border: 0px; margin: 0px; width:100%; height:8px;"/>
								</td>
							</tr>
						</table>
						</form>
							<!-- 基础资料结束 -->
							<!-- 经营现状开始 -->
					<div id="shopSituations">
							<div style="background-color:gray; font-weight: bold;">经营现状</div>
							<table style="width: 100%;font-size: 12px;border-collapse: collapse;">
							<tr style="text-align: center;border: 1px solid gray;font-weight: bold;">
								<td style="border: 1px solid gray;">门店名称</td>
								<td  style="border: 1px solid gray;">
									<input id="SHOP_NAME" name="SHOP_NAME" type="text" readonly style="border: 0px; margin: 0px; width:100%; height:8px;" />
								</td>
								<td style="border: 1px solid gray;">经营地址</td>
								<td  style="border: 1px solid gray;">
									<input id="BUSINESS_ADDRESS" name="BUSINESS_ADDRESS" readonly type="text" style="border: 0px; margin: 0px; width:100%; height:8px;" />
								</td>
							</tr>
							<tr style="text-align: center;border: 1px solid gray;font-weight: bold;">
								<td style="border: 1px solid gray;">营业执照</td>
								<td style="border: 1px solid gray;">
									<input id="BUSINESS_LICENSE" name="BUSINESS_LICENSE" readonly type="text" style="border: 0px; margin: 0px; width:100%; height:8px;" />
								</td>
								<td style="border: 1px solid gray;">许可证号</td>
								<td style="border: 1px solid gray;">
									<input id="LICENSE" name="LICENSE" type="text" readonly style="border: 0px; margin: 0px; width:100%; height:8px;" />
								</td>
							</tr>
							
							<tr style="text-align: center;border: 1px solid gray;font-weight: bold;">
								<td style="text-align: center;border: 1px solid gray;">经营时间</td>
								<td style="border: 1px solid gray;">
									<input type="text" id="BUSINESS_TIME_START" name="BUSINESS_TIME_START" readonly style="border: 0px; margin: 0px; width:80px; height:8px;" />到
									<input type="text" id="BUSINESS_TIME_END" name="BUSINESS_TIME_END" readonly style="border: 0px; margin: 0px; width:80px; height:8px;" />
								</td>
								<td style="text-align: center;border: 1px solid gray;">经营人员</td>
								<td style="font-weight: normal;border: 1px solid gray;">
									<input type="text" id="BUSINESS_MAN" name="BUSINESS_MAN" readonly style="border: 0px; margin: 0px; width:100%; height:8px;" />
								</td>
							</tr>
							<tr style="text-align: center;border: 1px solid gray;font-weight: bold;">
								<td style="text-align: center;border: 1px solid gray;">经营模式</td>
								<td style="font-weight: normal;border: 1px solid gray;">
								<input type="text" id="BUSINESS_MODEL" name="BUSINESS_MODEL" readonly style="border: 0px; margin: 0px; width:100%; height:8px;" />
								</td>
								<td style="text-align: center;border: 1px solid gray;">市场类型</td>
								<td style="font-weight: normal;border: 1px solid gray;">
									<input type="text" id="MARKET_TYPE" name="MARKET_TYPE" readonly style="border: 0px; margin: 0px; width:100%; height:8px;" />
								</td>
							</tr>
							<tr style="text-align: center;border: 1px solid gray;font-weight: bold;">
								<td rowspan="2" style="border: 1px solid gray;">经营情况</td>
								<td  style="text-align: center;border: 1px solid gray;">非烟商品种类</td>
								<td colspan="2" style="text-align: center;border: 1px solid gray;">非烟商品个数</td>
							</tr>
							<tr style="text-align: center;border: 1px solid gray;font-weight: bold;">
								<td colspan="1" style="font-weight: normal;border: 1px solid gray;">
									<input type="text" id="NON_TOBACCO_TYPE" name="NON_TOBACCO_TYPE" readonly style="border: 0px; margin: 0px; width:100%; height:8px;" />
								</td>
								<td colspan="2" style="font-weight: normal;border: 1px solid gray;">
									<input type="text" id="NON_TOBACCO_NUMBER" name="NON_TOBACCO_NUMBER" readonly style="border: 0px; margin: 0px; width:100%; height:8px;" />
								</td>
							</tr>
							</table>
							<!-- 经营现状结束 -->
							<!-- 店铺情况开始 -->
							<div style="background-color:gray; font-weight: bold;">店铺情况</div>
							<table style="width: 100%;font-size: 12px;border-collapse: collapse;">
							<tr style="text-align: center;border: 1px solid gray;font-weight: bold;">
								<td style="text-align: center;border: 1px solid gray;">门头标识</td>
								<td style="font-weight: normal;border: 1px solid gray;">
									<input type="text" id="SHOP_SIGN" name="SHOP_SIGN" readonly style="border: 0px; margin: 0px; width:100%; height:8px;"/>
								</td>
								<td style="text-align: center;border: 1px solid gray;">持有方式</td>
								<td style="font-weight: normal;border: 1px solid gray;">
									<input type="text" id="HOLD_WAY" name="HOLD_WAY" readonly style="border: 0px; margin: 0px; width:100%; height:8px;"/>
							</tr>
							<tr  style="text-align: center;border: 1px solid gray;font-weight: bold;">
								<td style="border: 1px solid gray;">租期</td>
								<td style="border: 1px solid gray;">
									<input id="RENT_TIME" name="RENT_TIME" readonly type="text" style="border: 0px; margin: 0px; width:100%; height:8px;" /></td>
								<td style="border: 1px solid gray;">租金</td>
								<td style="border: 1px solid gray;">
									<input id="RENT_MONEY" name="RENT_MONEY" readonly type="text" style="border: 0px; margin: 0px; width:100%; height:8px;" /></td>
							</tr>
							<tr style="text-align: center;border: 1px solid gray;font-weight: bold;">
								<td style="text-align: center;border: 1px solid gray;">店铺面积(㎡)</td>
								<td style="border: 1px solid gray;">
									<input type="text" id="SHOP_ACREAGE" name="SHOP_ACREAGE" readonly style="border: 0px; margin: 0px; width:100%; height:8px;" /></td>
								<td style="text-align: center;border: 1px solid gray;">店铺形状</td>
								<td style="font-weight: normal;border: 1px solid gray;">
									<input type="text" id="SHOP_SHAP" name="SHOP_SHAP" readonly style="border: 0px; margin: 0px; width:100%; height:8px;"/>
								</td>
							</tr>
							<tr  style="text-align: center;border: 1px solid gray;font-weight: bold;">
								<td style="border: 1px solid gray;">门头宽度(米)</td>
								<td style="border: 1px solid gray;">
									<input type="text" id="SHOP_WIDTH"  name="SHOP_WIDTH" readonly style="border: 0px; margin: 0px; width:100%; height:8px;" />
								</td>
								<td style="border: 1px solid gray;">层高(米)</td>
								<td style="border: 1px solid gray;">
								    <input type="text" id="SHOP_HEIGHT" name="SHOP_HEIGHT" readonly style="border: 0px; margin: 0px; width:100%; height:8px;" />
								</td>
							</tr>
							<tr style="text-align: center;border: 1px solid gray;font-weight: bold;">
								<td style="text-align: center;border: 1px solid gray;">店铺准备</td>
								<td style="font-weight: normal;border: 1px solid gray;">
									<input type="text" id="SHOP_EQUIPMENT" name="SHOP_EQUIPMENT" readonly style="border: 0px; margin: 0px; width:100%; height:8px;"/>
								</td>
								<td style="border: 1px solid gray;">门店销售系统名称</td>
								<td style="border: 1px solid gray;">
									<input type="text" id="SHOP_SYSTEM_NAME" name="SHOP_SYSTEM_NAME" readonly style="border: 0px; margin: 0px; width:100%; height:8px;" />
								</td>
							</tr>
							<tr  style="text-align: center;border: 1px solid gray;font-weight: bold;">
								<td style="border: 1px solid gray;">竞争情况</td>
								<td colspan="3" style="border: 1px solid gray;">
									<textarea id="COMPETE_SITUATION" name="COMPETE_SITUATION"  readonly style="border: 0px; margin: 0px;resize: none;width:100%;height:100%;"></textarea>
								</td>
							</tr>
							</table>
						</div>
							<!-- 店铺情况结束 -->
							<!-- 加盟投资经营意向开始 -->
							<form id="intentionForm">
							<div style="background-color:gray; font-weight: bold;">加盟投资经营意向</div>
							<table style="width: 100%;font-size: 12px;border-collapse: collapse;">
							<tr style="text-align: center;border: 1px solid gray;font-weight: bold;">
								<td style="border: 1px solid gray;">您所了解的本行业的品牌有：</td>
								<td colspan="3" style="border: 1px solid gray;">
									<textarea id="IN_KNOWN_BRANDS" name="IN_KNOWN_BRANDS" readonly style="border: 0px; margin: 0px;resize: none;width:100%;height:100%; "></textarea>
								</td>
							</tr>
							<tr style="text-align: center;border: 1px solid gray;font-weight: bold;">
								<td style="text-align: center;border: 1px solid gray;">获取加盟信息</td>
								<td colspan="3" style="font-weight: normal;border: 1px solid gray;">
								<input type="text" id="IN_GET_JOIN_INFO" name="IN_GET_JOIN_INFO" readonly style="border: 0px; margin: 0px; width:100%; height:8px;" />
							</tr>
							<tr style="text-align: center;border: 1px solid gray;font-weight: bold;">
								<td style="border: 1px solid gray;">您计划预算投资多少资金来运作整个项目</td>
								<td colspan="3" style="font-weight: normal;border: 1px solid gray;">
								<input id="IN_INVEST_MONEY" name="IN_INVEST_MONEY"  readonly type="text"  style="border: 0px; margin: 0px; width:100%; height:8px;"/> 
								</td>
							</tr>
							<tr  style="text-align: center;border: 1px solid gray;font-weight: bold;">
								<td colspan="4" style="font-weight: bold;border: 1px solid gray;">如果您选择加盟本公司品牌，您希望我们为您提供哪些支持与服务？</td>
							</tr>
							<tr style="text-align: center;border: 1px solid gray;font-weight: bold;">
							<td style="font-weight: bold;border: 1px solid gray;">1、支持:</td>
								<td colspan="3" style="font-weight: normal;border: 1px solid gray;">
								<textarea id="IN_HOPE_SUPPORT" name="IN_HOPE_SUPPORT" readonly  style="border: 0px; margin: 0px;resize: none;width:100%;height:100%;"></textarea>
								</td>
							</tr>
							<tr style="text-align: center;border: 1px solid gray;font-weight: bold;">
								<td style="font-weight: bold;border: 1px solid gray;">2、服务:</td>
								<td colspan="3" style="font-weight: normal;border: 1px solid gray;">
									<textarea id="IN_HOPE_SERVICE" name="IN_HOPE_SERVICE" readonly  style="border: 0px; margin: 0px;resize: none;width:100%;height:100%;"></textarea>
								</td>
							</tr>
							<tr style="text-align: center;border: 1px solid gray;font-weight: bold;">
								<td style="text-align: center;border: 1px solid gray;">采取管理方式</td>
								<td colspan="3" style="font-weight: normal;border: 1px solid gray;">
								  <input type="text" id="IN_MANAGEMENT_TYPE" name="IN_MANAGEMENT_TYPE" readonly style="border: 0px; margin: 0px; width:100%;height:5px;" />
								</td>
							</tr>
							<tr style="text-align: center;border: 1px solid gray;font-weight: bold;">
								<td style="text-align: center;border: 1px solid gray;">选择加盟方式</td>
								<td colspan="3" style="font-weight: normal;border: 1px solid gray;">
									<input type="text" id="IN_JOIN_TYPE" name="IN_JOIN_TYPE" readonly style="border: 0px; margin: 0px; width:100%; height: 5px;"  />
								</td>
							</tr>
							<tr style="text-align: center;border: 1px solid gray;font-weight: bold;">
								<td style="text-align: center;border: 1px solid gray;">意向加盟地区</td>
								<td colspan="3" style="font-weight: normal;border: 1px solid gray;">
									<input type="text" id="IN_JOIN_ADDRESS" name="IN_JOIN_ADDRESS" readonly style="border: 0px; margin: 0px;width:100%; height: 5px;" />
								</td>
							</tr>
							<!-- <tr style="text-align: center;border: 1px solid gray;font-weight: bold;">
								<td colspan="4" style="font-weight: normal;border: 1px solid gray;">您是否认同黔彩便利品牌文化，愿意遵守加盟合同条款，愿意按照黔彩便利经营管理标准和制度体系规范要求经营和管理自己的门店，愿意按照黔彩便利加盟终端管理制度，自愿无偿配置门头双屏机、电脑、摄像头等经营设施设备，并且对投资开店存在的经营风险有较清醒的认识。
							</tr>
						    <tr  style="text-align: center;border: 1px solid gray;font-weight: bold;">
								<td style="border: 1px solid gray;">签名:</td>
								<td style="border: 1px solid gray;">
									<input type="text" id="IN_SIGN" name="IN_SIGN" readonly style="border: 0px; margin: 0px;width:100%; height: 5px;" />
								</td>
								<td style="border: 1px solid gray;">时间:</td>
								<td style="border: 1px solid gray;">
									<input type="text" id="IN_SIGN_TIME" name="IN_SIGN_TIME" readonly style="border: 0px; width:100%; height: 5px; margin: 0px;" />
								</td>
							</tr> -->
							</table>
							</form>
							<!-- 审核开始  -->
							<form id="examForm">
							<input  type="text" style="display:none;"  id="APPLAY_NUMBER" name="APPLAY_NUMBER"/>
							<input  type="text"  style="display:none;"  id="APPLAY_TIME" name="APPLAY_TIME"/>
							<div style="color:white;background-color:gray; font-weight: bolder;text-align:center;">审核</div>
							<table style="width: 100%;font-size: 12px;border-collapse: collapse;">
								<tr style="text-align: center;border: 1px solid gray;font-weight: bold;">
									<td rowspan="4" style="border: 1px solid gray; text-align: center">市州专卖部门意见</td>
									<td colspan="5" style="border: 1px solid gray;font-weight:normal;">
										<input type="checkbox" id="displayLicense" name="displayLicense" value="1"/>亮证经营&nbsp;&nbsp;
										<input type="checkbox" id="markPrice" name="markPrice" value="1"/>明码标价&nbsp;&nbsp;
										<input type="checkbox" id="realPrice" name="realPrice" value="1"/>明码实价&nbsp;&nbsp;
										<input type="checkbox" id="warningSigns" name="warningSigns" value="1"/>警示标识
									</td>
								</tr>
								<tr style="text-align: center;border: 1px solid gray;font-weight: bold;">
									<td style="border: 1px solid gray; text-align: center">
										两年内有无销售假、私、非烟的行为
									</td>
									<td style="border: 1px solid gray;font-weight:normal;">
										<input type="radio" id="illegalSale" name="illegalSale" value="1"/>有
										<input type="radio" id="illegalSale" name="illegalSale" value="2"/>无
									</td>
									<td style="border: 1px solid gray; text-align: center">两年内有无二次批发、左右价格、扰乱市场的行为</td>
									<td style="border: 1px solid gray;font-weight:normal;">
										<input type="radio" id="illegalBehavior" name="illegalBehavior" value="1"/>有
										<input type="radio" id="illegalBehavior" name="illegalBehavior" value="2"/>无
									</td>
								</tr>
								<tr style="text-align: center;border: 1px solid gray;font-weight: bold;">
									<td style="border: 1px solid gray; text-align: center">初始办证时间</td>
									<td style="border: 1px solid gray;">
										<input type="date" id="handleLicenseTime" name="handleLicenseTime" style="border: 0px; margin: 0px; width:100%; height: 100%;"/>
									</td>
									<td style="border: 1px solid gray; text-align: center">经办时间</td>
									<td style="border: 1px solid gray;">
										<input type="date" id="marketExamTime" name="marketExamTime" style="border: 0px; margin: 0px; width:100%; height:100%;"/>
									</td>
								</tr>
								<tr style="text-align: center;border: 1px solid gray;font-weight: bold;">
									<td style="border: 1px solid gray; text-align: center">审批意见</td>
									<td style="border: 1px solid gray;">
										<textarea id="marketExamOpinion" name="marketExamOpinion" style="border: 0px; margin: 0px;width:100%;height:100%;resize:none;"></textarea>
									</td>
									<td style="border: 1px solid gray; text-align: center">经办人</td>
									<td style="border: 1px solid gray;">
										<input type="text" id="marketExamPerson" name="marketExamPerson" style="border: 0px; margin: 0px; width:100%; height: 100%;"/>
									</td>
								</tr>
								<tr style="text-align: center;border: 1px solid gray;font-weight: bold;">
									<td rowspan="6" style="border: 1px solid gray; text-align: center">市州营销部门审核</td>
									<td style="border: 1px solid gray; text-align: center">客户档位</td>
									<td style="border: 1px solid gray;">
										<input type="text" id="customerDegree" name="customerDegree" style="border: 0px; margin: 0px; width:100%; height: 8px;"/>
									</td>
									<td style="border: 1px solid gray; text-align: center">上柜卷烟品规个数</td>
									<td style="border: 1px solid gray;">
										<input type="text" id="tobaccoNumber" name="tobaccoNumber" style="border: 0px; margin: 0px; width:100%; height: 8px;"/>
									</td>
								</tr>
								<tr style="text-align: center;border: 1px solid gray;font-weight: bold;">
									<td style="border: 1px solid gray; text-align: center">前12个月进货（万元）</td>
									<td style="border: 1px solid gray;"><input type="text" id="purchaseMoney" name="purchaseMoney" style="border: 0px; margin: 0px; width:100%; height: 8px;"/></td>
									<td style="border: 1px solid gray;text-align: center">前12个月进货条数</td>
									<td style="border: 1px solid gray;"><input type="text" id="purchaseBars" name="purchaseBars" style="border: 0px; margin: 0px; width:100%; height: 8px;"/></td>
								</tr>
								<tr style="text-align: center;border: 1px solid gray;font-weight: bold;">
									<td style="border: 1px solid gray; text-align: center">商圈属性</td>
									<td colspan="3" style="border: 1px solid gray;font-weight:normal;">
										<input type="checkbox" id="businessAttribute" name="businessAttribute" value="1"/>商业区&nbsp;&nbsp;
										<input type="checkbox" id="businessAttribute" name="businessAttribute" value="2"/>住宅区&nbsp;&nbsp;
										<input type="checkbox" id="businessAttribute" name="businessAttribute" value="3"/>文教区&nbsp;&nbsp;
										<input type="checkbox" id="businessAttribute" name="businessAttribute" value="4"/>办公区&nbsp;&nbsp;
										<input type="checkbox" id="businessAttribute" name="businessAttribute" value="5"/>工业区&nbsp;&nbsp;
										<input type="checkbox" id="businessAttribute" name="businessAttribute" value="6"/>交通枢纽区&nbsp;&nbsp;
										<input type="checkbox" id="businessAttribute" name="businessAttribute" value="7"/>旅游休闲区 
									</td>
								</tr>
								<tr style="text-align: center;border: 1px solid gray;font-weight: bold;">
									<td style="border: 1px solid gray; text-align: center">主要消费群体</td>
									<td colspan="3" style="border: 1px solid gray;">
										<input type="text" id="consumerGroups" name="consumerGroups" style="border: 0px; margin: 0px; width:100%; height: 100%;"/>
									</td>
								</tr>
								<tr style="text-align: center;border: 1px solid gray;font-weight: bold;">
									<td style="border: 1px solid gray; text-align: center" colspan="4">营销能力</td>
								</tr>
								<tr style="text-align: center;border: 1px solid gray;font-weight: bold;">
									<td style="border: 1px solid gray; text-align: center">体验区面积</td>
									<td colspan="3" style="border: 1px solid gray;font-weight:normal;">
										<input type="radio" id="experienceAcreage" name="experienceAcreage" value="1"/>有&nbsp;
										<!-- <input type="text" id="experienceAcreage" name="experienceAcreage" style="width:50px;border-bottom:1px solid darkseagreen; outline: none;height:5px;border-left: none;border-right: none;border-top: none;"/>㎡&nbsp;&nbsp; -->
										<input type="radio" id="experienceAcreage" name="experienceAcreage" value="2"/>无
									</td>
								</tr>
								<tr style="text-align: center;border: 1px solid gray;font-weight: bold;">
									<td rowspan="4" style="text-align: center">商贸公司意见</td>
									<td style="border: 1px solid gray; text-align: center">审批意见</td>
									<td colspan="4" style="border: 1px solid gray;">
										<textarea  id="businessExamOpinion" name="businessExamOpinion" style="resize:none;border: 0px; margin: 0px; width:100%; height: 100%;"></textarea>
									</td>
								</tr>
								<tr style="text-align: center;border: 1px solid gray;font-weight: bold;">
									<td style="text-align: center">经办人</td>
									<td style="border: 1px solid gray;">
										<input type="text" id="businessExamPerson" name="businessExamPerson" style="border: 0px; margin: 0px; width:100%; height: 100%;"/>
									</td>
									<td style="border: 1px solid gray; text-align: center">经办时间</td>
									<td style="border: 1px solid gray;">
										<input type="date" id="businessExamTime" name="businessExamTime" style="border: 0px; margin: 0px; width:100%; height: 100%;"/>
									</td>
								</tr>
								<tr style="text-align: center;border: 1px solid gray;font-weight: bold;">
									<td style="border: 1px solid gray; text-align: center">拓展部门意见</td>
									<td colspan="3" style="border: 1px solid gray;">
										<textarea  id="expandDepartmentOpinion" name="expandDepartmentOpinion" style="border: 0px; margin: 0px;width:100%;height:100%;resize:none;"></textarea>
									</td>
								</tr>
								<tr style="text-align: center;border: 1px solid gray;font-weight: bold;">
									<td style="border: 1px solid gray; text-align: center">公司负责人意见</td>
									<td colspan="3" style="border: 1px solid gray;">
										<textarea id="chargeManOpinion" name="chargeManOpinion" style="border: 0px; margin: 0px;width:100%;height:100%;resize:none;"></textarea>
									</td>
								</tr>
							</table>
						</form>
					</div>

					<div class="row hide" id="businessLicenseDiv">
						<div style="margin:10px auto;border:1px solid #000;width:320px;height:240px;">
							<img id="showImageInfoImg" style="width:320px;height:240px;" src="" alt="..." class="img-thumbnail">
						</div>
						<p style="font-size: 12px; text-align: center;">图片显示(图片窗口大小为320*240，上传图片最佳宽高比例为4：3,图片大小限制在300K以内)</p>
						<div style="margin-top: 10px; text-align: center;">
							<input type="file" name="file" id="image_file_input" class="inputfile hide"/>
							<label for="image_file_input"><i class="ace-icon fa fa-folder-open"></i> 请选择图片</label>
						</div>
						<div style="margin-top: 10px; text-align: center;">
							<button class="btn btn-white btn-info btn-sm customBtn btn-xs" type="button" v-on:click="submitImg">上传</button>
							<button class="btn btn-white btn-info btn-sm customBtn btn-xs" type="button" v-on:click="">删除</button>
						</div>
					</div>

					<div class="row hide" id="licenceDiv">
						<div style="margin:10px auto;border:1px solid #000;width:320px;height:240px;">
							<img id="showImageInfoImg1" style="width:320px;height:240px;" src="" alt="..." class="img-thumbnail">
						</div>
						<p style="font-size: 12px; text-align: center;">图片显示(图片窗口大小为320*240，上传图片最佳宽高比例为4：3,图片大小限制在300K以内)</p>
						<div style="margin-top: 10px; text-align: center;">
							<input type="file" name="file" id="image_file_input1" class="inputfile hide"/>
							<label for="image_file_input1"><i class="ace-icon fa fa-folder-open"></i> 请选择图片</label>
						</div>
						<div style="margin-top: 10px; text-align: center;">
							<button class="btn btn-white btn-info btn-sm customBtn btn-xs" type="button" v-on:click="submitImg1">上传</button>
							<button class="btn btn-white btn-info btn-sm customBtn btn-xs" type="button" v-on:click="">删除</button>
						</div>
					</div>
					<div class="modal-footer" style="background-color: #ffffff">
						<button type="button" class="btn btn-default btn-xs" data-dismiss="modal" v-on:click="close">关闭</button>
						<button type="button" class="btn btn-primary btn-xs" id="examApplay">提交审批</button>
					</div>


				</form>
			</div>
		</div>
	</div>


	<!-- 区域数型内容 -->
	<div id="authorizationInfoContent" class="hide">
		<div class="content_wrap">
			<div class="zTreeDemoBackground left" style="width: 300px; border: solid 2px #f5f5f5;">
				<ul id="treeDemo" class="ztree"></ul>
			</div>
		</div>
		<%--<div class="right" style="left: 190px;top: 42px;position: fixed;">--%>
			<%--<div class="button-len col-sm-12" style="margin-top: 5px;">--%>
				<%--<label style="">机构类型：</label>--%>
				<%--&lt;%&ndash;<select class="input-sm" id="shopId" style="height: 20px;">&ndash;%&gt;--%>
				<%--&lt;%&ndash;<option value="0">全部</option>&ndash;%&gt;--%>
				<%--&lt;%&ndash;<option :value="obj.shopId" v-for="(obj, index) in arrayShop">{{ obj.shopName }}</option>&ndash;%&gt;--%>
				<%--&lt;%&ndash;</select>&ndash;%&gt;--%>

				<%--<select class="input-sm" id="" style="height: 20px;">--%>
					<%--<option value="1">全部</option>--%>
					<%--<option value="2">直营店</option>--%>
					<%--<option value="3">加盟店</option>--%>
					<%--<option value="4">加盟总部/加盟商</option>--%>
				<%--</select>--%>

				<%--<label>关键字：</label>--%>
				<%--<input type="text" class="input-sm" id="keyword" placeholder="关键字可输入机构编码、名称进行查询" style="width: 249px; height: 20px;"/>--%>
				<%--<button class="btn btn-sm btn-white btn-info search-len customBtn" style="height: 20px;"--%>
						<%--onclick="searchShop()">--%>
					<%--<div style="margin-top: -3.5px;">查询</div>--%>
				<%--</button>--%>
			<%--</div>--%>
			<%--<div class="button-len col-sm-12">--%>
				<%--<table id="grid-shop-table"></table>--%>
				<%--<div id="grid-shop-pager"></div>--%>
			<%--</div>--%>
		<%--</div>--%>
		<div>
			<%--<button id="getShopIdBtn" class="btn btn-success btn-sm" style="left: 250px;top: 450px;position: fixed;">确认</button>--%>
		</div>
	</div>


	<input type="text" name="fileStr" id="fileStr" style="display: none"/>
	<input type="text" name="fileType" id="fileType" style="display:none"/>

	<input type="text" name="fileStr1" id="fileStr1" style="display: none"/>
	<input type="text" name="fileType1" id="fileType1" style="display:none"/>
</div>

<!-- 导出Excel -->
<form action="${contextPath}/sys/clouderp/clouderpExportExcel" method="post" id="exportExcel" style="display:none">
	<input type="hidden" id="exportExcelData-quXianName" name="stringMap['quXianName']">
	<input type="hidden" id="exportExcelData-channelName" name="stringMap['channelName']">
	<input type="hidden" id="exportExcelData-empName" name="stringMap['empName']">
	<input type="hidden" id="exportExcelData-custName" name="stringMap['custName']">
	<input type="hidden" id="exportExcelData-custCode" name="stringMap['custCode']">

	<input type="hidden" id="exportExcelData-shopName" name="stringMap['shopName']">
	<input type="hidden" id="exportExcelData-phone" name="stringMap['phone']">
	<input type="hidden" id="exportExcelData-isExp" name="stringMap['isExp']">
	<input type="hidden" id="exportExcelData-isAuth" name="stringMap['isAuth']">

	<input type="hidden" id="exportExcelData-firstTime" name="stringMap['firstTime']">
	<input type="hidden" id="exportExcelData-endTime" name="stringMap['endTime']">
	<input type="hidden" name="tableType" value="shop">
</form>

<!-- 通用 -->
<script type="text/javascript">

    var grid_selector = "#grid-table";
    var pager_selector = "#grid-pager";

    var img64 = "";
    $("#showImageInfoImg").attr("src", img64);
    $("#showImageInfoImg1").attr("src", img64);

    var laypage = layui.laypage,
        layer = layui.layer
    laydate = layui.laydate;

    var queryModel = {
        //分页参数
        page: '1',
        rows: '10',
        //图片参数

    }

    var app = new Vue({
        el: '#app',
        data: {
            objects: [],
            arrayShop: [],
        },
        methods: {
            tableShow: function () {
                $("#alertTitle").html("新增")
                $("#businessLicenseDiv").addClass("hide")
                $("#licenceDiv").addClass("hide")
                $("#smallTitle").addClass("hide")
                $("#tableDiv").removeClass("hide")
            },
            businessLicenseShow: function () {
                $("#alertTitle").html("营业执照")
                $("#tableDiv").addClass("hide")
                $("#licenceDiv").addClass("hide")
                $("#smallTitle").addClass("hide")
                $("#businessLicenseDiv").removeClass("hide")
				console.log("营业执照");
            },
            licenceShow: function () {
                $("#alertTitle").html("许可证")
                $("#tableDiv").addClass("hide")
                $("#smallTitle").addClass("hide")
                $("#businessLicenseDiv").addClass("hide")
                $("#licenceDiv").removeClass("hide")
                console.log("许可证");
            },
			/**
            saveSupplier: function () {
                $("#alertTitle").html("新增")
                $("#businessLicenseDiv").addClass("hide")
                $("#licenceDiv").addClass("hide")
                $("#tableDiv").removeClass("hide")
                $("#smallTitle").addClass("hide")
                $("#showImageInfoImg").attr("src",img64)
                $("#showImageInfoImg1").attr("src",img64)
                queryObjects()
            },
            addShop: function () {
                $("#alertTitle").html("新增")
                $("#businessLicenseDiv").addClass("hide")
                $("#licenceDiv").addClass("hide")
                $("#tableDiv").removeClass("hide")
                $("#smallTitle").addClass("hide")
                $("#smallTitle").addClass("hide")
                $("#showImageInfoImg").attr("src",img64)
                $("#showImageInfoImg1").attr("src",img64)
                var rowData = {}
                editShop(rowData)
            },
			 **/
            submitImg: function () {
                submitImg("1", true)
            },
            submitImg1: function () {
                submitImg("2", true)
            },
            close: function () {
                layer.close(modalIndexShop);
                $("#businessLicenseDiv").addClass("hide")
                $("#licenceDiv").addClass("hide")
                $("#smallTitle").addClass("hide")
                $("#tableDiv").removeClass("hide")
            }
        }
    });
</script>

<!-- page specific plugin scripts -->
<script type="text/javascript">

    var filters = {
        "rules": [
            {
                "field": "type",
                "data": 'kt'
            }
        ]
    };
    var grid_data = {'filters': JSON.stringify(filters)};

	var scripts = [null,"${contextPath}/static/ace/components/bootstrap-datepicker/dist/js/bootstrap-datepicker.js","${contextPath}/static/ace/components/jqGrid/js/jquery.jqGrid.js","${contextPath}/static/ace/components/jqGrid/js/i18n/grid.locale-cn.js", "${contextPath}/static/layer/layer.js","${contextPath}/static/ztree/js/jquery.ztree.core-3.5.js", "${contextPath}/static/ztree/js/jquery.ztree.excheck-3.5.js", null]
	$('.page-content-area').ace_ajax('loadScripts', scripts, function() {
	
	jQuery(function($) {
		
		var parent_column = $(grid_selector).closest('[class*="col-"]');
		//resize to fit page size
		$(window).on('resize.jqGrid', function () {
			$(grid_selector).jqGrid( 'setGridWidth', parent_column.width() );
	    })
		
		//resize on sidebar collapse/expand
		$(document).on('settings.ace.jqGrid' , function(ev, event_name, collapsed) {
			if( event_name === 'sidebar_collapsed' || event_name === 'main_container_fixed' ) {
				//setTimeout is for webkit only to give time for DOM changes and then redraw!!!
				setTimeout(function() {
					$(grid_selector).jqGrid( 'setGridWidth', parent_column.width() );
				}, 20);
			}
	    })
		
		jQuery(grid_selector).jqGrid({
			subGrid : false, 
			url: "${contextPath}/ktJoin/getApplayInfo",
			postData: grid_data,
			datatype: "json",
			mtype : 'POST',
			height: 300,
			colNames:['SHOPID','店铺名称','店铺地址','申请人', '类型', '状态','电话号码','是否有自己的店铺', 'AGE', 'SEX',  
			          'EDUCATION' , 'ID_CARD_NO','CONTACT_NUMBER', 'EMAIL','JOB','WORK_TIME',
			          'JOIN_BODY','BUSINESS_LICENSE','LICENSE','BUSINESS_TIME_START','BUSINESS_TIME_END','BUSINESS_MAN',
			          'BUSINESS_MODEL','MARKET_TYPE','BUSINESS_TYPE','NON_TOBACCO_TYPE',
			          'NON_TOBACCO_NUMBER','SHOP_SIGN','HOLD_WAY','RENT_TIME','RENT_MONEY',
			          'SHOP_ACREAGE','SHOP_SHAP','SHOP_WIDTH','SHOP_HEIGHT','SHOP_EQUIPMENT',
			          'SHOP_SYSTEM_NAME','COMPETE_SITUATION','KNOWN_BRANDS','GET_JOIN_INFO',
			          'INVEST_MONEY','HOPE_SUPPORT','HOPE_SERVICE','MANAGEMENT_TYPE','JOIN_TYPE',
			          'JOIN_ADDRESS','SIGN','SIGN_TIME','APPLAY_TIME','APPLAY_NUMBER'],
			colModel:[
				{name:'shopId',index:'shopId', width:60, editable: true,hidden:true},
				{name:'SHOP_NAME',index:'SHOP_NAME',width:90, editable:false, sortable:false,hidden:true},
				{name:'BUSINESS_ADDRESS',index:'BUSINESS_ADDRESS', width:150,editable: false, sortable:false,hidden:true},
				{name:'BASE_NAME',index:'BASE_NAME', width:90, editable: false, sortable:false},
				{name:'shopType',index:'shopType', hidden:false, width:70, sortable:false, editable: false,
					formatter:function(){
						return '加盟';
					}
				},
                {
                    name:'STATUS',index:'STATUS', hidden:false, width:70, editable: true,
                    formatter: function (v, x, r) {
                    	var status = r.APPLAY_STATUS;
                        if(status == '0'){
                        	status = '审核中'
                        }else if(status == '1'){
                        	status = '通过'
                        }else if(status == '2'){
                        	status = '未通过'
                        }
                        return status;
                    },
				},
                {name:'BASE_PHONE_NUMBER',index:'BASE_PHONE_NUMBER', width:90, editable: false, sortable:false},
                {name:'BASE_OWN_SHOP',index:'BASE_OWN_SHOP', hidden:false,
	                formatter:function(val){
	                	var ownShop = ''
	                	if(val == '0'){
	                		ownShop = '没有';
	                	}else{
	                		ownShop = '有'
	                	}
	                	return ownShop;
	                }	
                },
                {name:'BASE_AGE',index:'BASE_AGE',hidden:true},
                {name:'BAES_SEX',index:'BAES_SEX', hidden: true,},
				{name:'BASE_EDUCATION',index:'BASE_EDUCATION', hidden:true},
				{name:'BASE_ID_CARD_NO',index:'BASE_ID_CARD_NO',hidden:true,},
				{name:'BASE_CONTACT_NUMBER',index:'BASE_CONTACT_NUMBER', hidden:true,},
                {name:'BASE_EMAIL',index:'BASE_EMAIL', hidden:true,},
                {name:'BASE_JOB',index:'BASE_JOB', hidden:true,},
                {name:'BASE_WORK_TIME',index:'BASE_WORK_TIME', hidden:true,
                	formatter:function(val){
                		return jsonTimeStamp(val);
                	}
                },
                {name:'BASE_JOIN_BODY',index:'BASE_JOIN_BODY', hidden:true,
                	formatter:function(val){
                		var res = '';
                		if(val == '1'){
                			res = '个人'
                		}else if(val == '2'){
                			res = '合伙'
                		}else if(val == '3'){
                			res = '企业'
                		}else if(val == '4'){
                			res = '其他'
                		}
                		return res;
                	}	
                },
                {name:'BUSINESS_LICENSE',index:'BUSINESS_LICENSE', hidden:true,},
                {name:'LICENSE',index:'LICENSE', hidden:true,},
                {name:'BUSINESS_TIME_START',index:'BUSINESS_TIME_START', hidden:true,},
                {name:'BUSINESS_TIME_END',index:'BUSINESS_TIME_END', hidden:true,},
                {name:'BUSINESS_MAN',index:'BUSINESS_MAN', hidden:true},
                {name:'BUSINESS_MODEL',index:'BUSINESS_MODEL', hidden:true,
                	formatter:function(val){
                		var res = '';
                		if(val == '1'){
                			res = '个体零售经营'
                		}else if(val == '2'){
                			res = '公司团队运作'
                		}else if(val == '3'){
                			res = '连锁经营管理'
                		}else if(val == '4'){
                			res = '其他'
                		}
                		return res;
                	}
                },
                {name:'MARKET_TYPE',index:'MARKET_TYPE', hidden:true,
                	formatter:function(val){
                		var res = '';
                		if(val == '1'){
                			res = '城镇'
                		}else if(val == '2'){
                			res = '乡村'
                		}
                		return res;
                	}
                },
                {name:'BUSINESS_TYPE',index:'BUSINESS_TYPE', hidden:true,
                	formatter:function(val){
                		var res = '';
                		if(val == '1'){
                			res = '食杂店'
                		}else if(val == '2'){
                			res = '便利店'
                		}else if(val == '3'){
                			res = '超市'
                		}else if(val == '4'){
                			res = '商场'
                		}else if(val == '5'){
                			res = '烟酒商店'
                		}else if(val == '6'){
                			res = '娱乐服务'
                		}else if(val == '7'){
                			res = '其他'
                		}
                		return res;
                	}
                },
                {name:'NON_TOBACCO_TYPE',index:'NON_TOBACCO_TYPE', hidden:true},
                {name:'NON_TOBACCO_NUMBER',index:'NON_TOBACCO_NUMBER', hidden:true,
                	formatter:function(val){
                		var res = '';
                		if(val == '1'){
                			res = '100以下'
                		}else if(val == '2'){
                			res = '100—300'
                		}else if(val == '3'){
                			res = '300—500'
                		}else if(val == '4'){
                			res = '500—800'
                		}else if(val == '4'){
                			res = '800以上'
                		}
                		return res;
                	}
                },
                {name:'SHOP_SIGN',index:'SHOP_SIGN', hidden:true},
                {name:'HOLD_WAY',index:'HOLD_WAY', hidden:true,
                	formatter:function(val){
                		var res = '';
                		if(val == '1'){
                			res = '自有'
                		}else if(val == '2'){
                			res = '租赁'
                		}else if(val == '3'){
                			res = '承包'
                		}else if(val == '4'){
                			res = '其他'
                		}
                		return res;
                	}
                },
                {name:'RENT_TIME',index:'RENT_TIME', hidden:true,},
                {name:'RENT_MONEY',index:'RENT_MONEY', hidden:true,},
                {name:'SHOP_ACREAGE',index:'SHOP_ACREAGE', hidden:true,},
                {name:'SHOP_SHAP',index:'SHOP_SHAP', hidden:true,
                	formatter:function(val){
                		var res = '';
                		if(val == '1'){
                			res = '长方形'
                		}else if(val == '2'){
                			res = '正方形'
                		}else if(val == '3'){
                			res = '异形'
                		}else if(val == '4'){
                			res = '其他'
                		}
                		return res;
                	}
                },
                {name:'SHOP_WIDTH',index:'SHOP_WIDTH', hidden:true,},
                {name:'SHOP_HEIGHT',index:'SHOP_HEIGHT', hidden:true,},
                {name:'SHOP_EQUIPMENT',index:'SHOP_EQUIPMENT', hidden:true},
                {name:'SHOP_SYSTEM_NAME',index:'SHOP_SYSTEM_NAME', hidden:true,},
                {name:'COMPETE_SITUATION',index:'COMPETE_SITUATION', hidden:true,},
                {name:'IN_KNOWN_BRANDS',index:'IN_KNOWN_BRANDS', hidden:true,},
                {name:'IN_GET_JOIN_INFO',index:'IN_GET_JOIN_INFO', hidden:true,
                	formatter:function(val){
                		var res = val;
                		if(val == '1'){
                			res = '门店广告'
                		}else if(val == '2'){
                			res = '微信公众号'
                		}else if(val == '3'){
                			res = '门店人员'
                		}else if(val == '4'){
                			res = '熟人推荐'
                		}else if(val == '5'){
                			res = '加盟热线'
                		}else if(val == '6'){
                			res = '其他'
                		}
                		return res;
                	}
                },
                {name:'IN_INVEST_MONEY',index:'IN_INVEST_MONEY', hidden:true,
                	formatter:function(val){
                		var res = '';
                		if(val == '1'){
                			res = '0-5万'
                		}else if(val == '2'){
                			res = '5-10万'
                		}else if(val == '3'){
                			res = '10-15万'
                		}else if(val == '4'){
                			res = '20万以上'
                		}else if(val == '5'){
                			res = '其他'
                		}
                		return res;
                	}
                },
                {name:'IN_HOPE_SUPPORT',index:'IN_HOPE_SUPPORT', hidden:true,},
                {name:'IN_HOPE_SERVICE',index:'IN_HOPE_SERVICE', hidden:true,},
                {name:'IN_MANAGEMENT_TYPE',index:'IN_MANAGEMENT_TYPE', hidden:true,
                	formatter:function(val){
                		var res = val;
                		if(val == '1'){
                			res = '自己管理'
                		}else if(val == '2'){
                			res = '亲戚经营管理'
                		}else if(val == '3'){
                			res = '招聘经理人管理'
                		}else if(val == '4'){
                			res = '其他'
                		}
                		return res;
                	}
                },
                {name:'IN_JOIN_TYPE',index:'IN_JOIN_TYPE', hidden:true,
                	formatter:function(val){
                		var res = '';
                		if(val == '1'){
                			res = '特许加盟'
                		}else if(val == '2'){
                			res = '品牌加盟'
                		}else if(val == '3'){
                			res = '合约加盟'
                		}
                		return res;
                	}
                },
                {name:'IN_JOIN_ADDRESS',index:'IN_JOIN_ADDRESS', hidden:true},
                {name:'IN_SIGN',index:'IN_SIGN', hidden:true,},
                {name:'IN_SIGN_TIME',index:'IN_SIGN_TIME', hidden:true,
                	formatter:function(val){
                		return jsonTimeStamp(val);
                	}
                },
                {name:'APPLAY_TIME',index:'APPLAY_TIME', hidden:true,
                	formatter:function(val){
                		return jsonTimeStamp(val);
                	}
                },
                {name:'APPLAY_NUMBER',index:'APPLAY_NUMBER', hidden:true},

			], 
			sortname : "createTime",
			sortorder : "desc",
			viewrecords : true,
			rowNum:10,
			rowList:[10,20,30],
			pager : pager_selector,
			altRows: true,
			//toppager: true,
			
			multiselect: false,
			//multikey: "ctrlKey",
	        multiboxonly: false,

            loadComplete : function() {
				var table = this;
				setTimeout(function(){
					styleCheckbox(table);
					
					updateActionIcons(table);
					updatePagerIcons(table);
					enableTooltips(table);
				}, 0);
			},
	
			editurl: "${contextPath}/ktCommon/saveShop",//nothing is saved
			caption: "店铺信息",
			jsonReader : {  
				root:"recordList",  
				page: "currentPage",  
				total: "pageCount",  
				records: "recordCount"
			}
	
			//,autowidth: true,
	
	
			/**
			,
			grouping:true, 
			groupingView : { 
				 groupField : ['name'],
				 groupDataSorted : true,
				 plusicon : 'fa fa-chevron-down bigger-110',
				 minusicon : 'fa fa-chevron-up bigger-110'
			},
			caption: "Grouping"
			*/
	
		});
		$(window).triggerHandler('resize.jqGrid');//trigger window resize to make the grid get the correct size

		$("#editShop").click(function() {
			var id = $(grid_selector).jqGrid('getGridParam', 'selrow');
			if (!id) {
				layer.msg( "提示：请选择一条信息");
				return;
			}
            var rowData = $(grid_selector).jqGrid('getRowData',id);
			console.log(rowData)
			$(grid_selector).jqGrid("editGridRow",id,{
				// edit record form
				width : 500,
				closeAfterEdit : true,
				//editData :
				recreateForm : true,
				viewPagerButtons : false,
				beforeShowForm : function(e) {
					var form = $(e[0]);
					form.closest('.ui-jqdialog').find('.ui-jqdialog-titlebar')
							.wrapInner('<div class="widget-header" />');
					style_edit_form(form);
				},
				beforeSubmit : function(postdata, formid) {
					/*var isExp = rowData.isExp;
					switch (postdata.isExp) {
						case '1' :
							if (isExp == '是') {
								return [false,"该店铺已经是试点用户"];
							}
							break;
						case '0' :
							if (isExp == '否') {
								return [false,"该店铺已经不是试点用户"];
							}
							break;
						default  :
							break;
					}*/
					return [true,""]
					//console.log(postdata)
				   // console.log(formid)

				},
				afterSubmit : function(response, postdata) {
					var result = eval('('+ response.responseText + ')');
					console.log(result);
                    layer.msg(result.message,{icon:1})
					return [result.success,result.message,0] ;
					},
				errorTextFormat : function(response) {
					//console.log("错误"+response.responseText);
					//var result = response.responseText;
                    return "服务器异常，稍后再试";
				}
			});
		});

	
		//enable search/filter toolbar
		//jQuery(grid_selector).jqGrid('filterToolbar',{defaultSearch:true,stringResult:true})
		//jQuery(grid_selector).filterToolbar({});
	
	
		//switch element when editing inline
		function aceSwitch( cellvalue, options, cell ) {
			setTimeout(function(){
				$(cell) .find('input[type=checkbox]')
					.addClass('ace ace-switch ace-switch-5')
					.after('<span class="lbl"></span>');
			}, 0);
		}
		//enable datepicker
		function pickDate( cellvalue, options, cell ) {
			setTimeout(function(){
				$(cell) .find('input[type=text]')
					.datepicker({format:'yyyy-mm-dd' , autoclose:true}); 
			}, 0);
		}
	
	
		//navButtons
		jQuery(grid_selector).jqGrid('navGrid',pager_selector,
			{ 	//navbar options
				edit: false,
				editicon : 'ace-icon fa fa-pencil blue',
				add: false,
				addicon : 'ace-icon fa fa-plus-circle purple',
				del: false,
				delicon : 'ace-icon fa fa-trash-o red',
				search: false,
				searchicon : 'ace-icon fa fa-search orange',
				refresh: true,
				refreshicon : 'ace-icon fa fa-refresh green',
				view: false,
				viewicon : 'ace-icon fa fa-search-plus grey',
			},
			{
				//edit record form
				//closeAfterEdit: true,
				//width: 700,
				recreateForm: true,
				beforeShowForm : function(e) {
					var form = $(e[0]);
					form.closest('.ui-jqdialog').find('.ui-jqdialog-titlebar').wrapInner('<div class="widget-header" />')
					style_edit_form(form);
				}
			},
			{
				//new record form
				//width: 700,
				closeAfterAdd: true,
				recreateForm: true,
				viewPagerButtons: false,
				beforeShowForm : function(e) {
					var form = $(e[0]);
					form.closest('.ui-jqdialog').find('.ui-jqdialog-titlebar')
					.wrapInner('<div class="widget-header" />')
					style_edit_form(form);
				}
			},
			{
				//delete record form
				recreateForm: true,
				beforeShowForm : function(e) {
					var form = $(e[0]);
					if(form.data('styled')) return false;
					
					form.closest('.ui-jqdialog').find('.ui-jqdialog-titlebar').wrapInner('<div class="widget-header" />')
					style_delete_form(form);
					
					form.data('styled', true);
				},
				onClick : function(e) {
					//alert(1);
				}
			},
			{
				//search form
				recreateForm: true,
				afterShowSearch: function(e){
					var form = $(e[0]);
					form.closest('.ui-jqdialog').find('.ui-jqdialog-title').wrap('<div class="widget-header" />')
					style_search_form(form);
				},
				afterRedraw: function(){
					style_search_filters($(this));
				}
				,
				multipleSearch: true,
				/**
				multipleGroup:true,
				showQuery: true
				*/
			},
			{
				//view record form
				recreateForm: true,
				beforeShowForm: function(e){
					var form = $(e[0]);
					form.closest('.ui-jqdialog').find('.ui-jqdialog-title').wrap('<div class="widget-header" />')
				}
			}
		)
	
	
		
		function style_edit_form(form) {
			//enable datepicker on "sdate" field and switches for "stock" field
			//form.find('input[name=sdate]').datepicker({format:'yyyy-mm-dd' , autoclose:true})
			
			//form.find('input[name=stock]').addClass('ace ace-switch ace-switch-5').after('<span class="lbl"></span>');
					   //don't wrap inside a label element, the checkbox value won't be submitted (POST'ed)
					  //.addClass('ace ace-switch ace-switch-5').wrap('<label class="inline" />').after('<span class="lbl"></span>');
	
					
			//update buttons classes
			var buttons = form.next().find('.EditButton .fm-button');
			buttons.addClass('btn btn-sm').find('[class*="-icon"]').hide();//ui-icon, s-icon
			buttons.eq(0).addClass('btn-primary').prepend('<i class="ace-icon fa fa-check"></i>');
			buttons.eq(1).prepend('<i class="ace-icon fa fa-times"></i>')
			
			buttons = form.next().find('.navButton a');
			buttons.find('.ui-icon').hide();
			buttons.eq(0).append('<i class="ace-icon fa fa-chevron-left"></i>');
			buttons.eq(1).append('<i class="ace-icon fa fa-chevron-right"></i>');		
		}
	
		function style_delete_form(form) {
			var buttons = form.next().find('.EditButton .fm-button');
			buttons.addClass('btn btn-sm btn-white btn-round').find('[class*="-icon"]').hide();//ui-icon, s-icon
			buttons.eq(0).addClass('btn-danger').prepend('<i class="ace-icon fa fa-trash-o"></i>');
			buttons.eq(1).addClass('btn-default').prepend('<i class="ace-icon fa fa-times"></i>')
		}
		
		function style_search_filters(form) {
			form.find('.delete-rule').val('X');
			form.find('.add-rule').addClass('btn btn-xs btn-primary');
			form.find('.add-group').addClass('btn btn-xs btn-success');
			form.find('.delete-group').addClass('btn btn-xs btn-danger');
		}
		function style_search_form(form) {
			var dialog = form.closest('.ui-jqdialog');
			var buttons = dialog.find('.EditTable')
			buttons.find('.EditButton a[id*="_reset"]').addClass('btn btn-sm btn-info').find('.ui-icon').attr('class', 'ace-icon fa fa-retweet');
			buttons.find('.EditButton a[id*="_query"]').addClass('btn btn-sm btn-inverse').find('.ui-icon').attr('class', 'ace-icon fa fa-comment-o');
			buttons.find('.EditButton a[id*="_search"]').addClass('btn btn-sm btn-purple').find('.ui-icon').attr('class', 'ace-icon fa fa-search');
		}
		
		function beforeDeleteCallback(e) {
			var form = $(e[0]);
			if(form.data('styled')) return false;
			
			form.closest('.ui-jqdialog').find('.ui-jqdialog-titlebar').wrapInner('<div class="widget-header" />')
			style_delete_form(form);
			form.data('styled', true);
		}
		
		function beforeEditCallback(e) {
			var form = $(e[0]);
			form.closest('.ui-jqdialog').find('.ui-jqdialog-titlebar').wrapInner('<div class="widget-header" />')
			style_edit_form(form);
		}
	
	
	
		//it causes some flicker when reloading or navigating grid
		//it may be possible to have some custom formatter to do this as the grid is being created to prevent this
		//or go back to default browser checkbox styles for the grid
		function styleCheckbox(table) {
		/**
			$(table).find('input:checkbox').addClass('ace')
			.wrap('<label />')
			.after('<span class="lbl align-top" />')
	
	
			$('.ui-jqgrid-labels th[id*="_cb"]:first-child')
			.find('input.cbox[type=checkbox]').addClass('ace')
			.wrap('<label />').after('<span class="lbl align-top" />');
		*/
		}
		
	
		//unlike navButtons icons, action icons in rows seem to be hard-coded
		//you can change them like this in here if you want
		function updateActionIcons(table) {
			/**
			var replacement = 
			{
				'ui-ace-icon fa fa-pencil' : 'ace-icon fa fa-pencil blue',
				'ui-ace-icon fa fa-trash-o' : 'ace-icon fa fa-trash-o red',
				'ui-icon-disk' : 'ace-icon fa fa-check green',
				'ui-icon-cancel' : 'ace-icon fa fa-times red'
			};
			$(table).find('.ui-pg-div span.ui-icon').each(function(){
				var icon = $(this);
				var $class = $.trim(icon.attr('class').replace('ui-icon', ''));
				if($class in replacement) icon.attr('class', 'ui-icon '+replacement[$class]);
			})
			*/
		}
		
		//replace icons with FontAwesome icons like above
		function updatePagerIcons(table) {
			var replacement = 
			{
				'ui-icon-seek-first' : 'ace-icon fa fa-angle-double-left bigger-140',
				'ui-icon-seek-prev' : 'ace-icon fa fa-angle-left bigger-140',
				'ui-icon-seek-next' : 'ace-icon fa fa-angle-right bigger-140',
				'ui-icon-seek-end' : 'ace-icon fa fa-angle-double-right bigger-140'
			};
			$('.ui-pg-table:not(.navtable) > tbody > tr > .ui-pg-button > .ui-icon').each(function(){
				var icon = $(this);
				var $class = $.trim(icon.attr('class').replace('ui-icon', ''));
				
				if($class in replacement) icon.attr('class', 'ui-icon '+replacement[$class]);
			})
		}
	
		function enableTooltips(table) {
			$('.navtable .ui-pg-button').tooltip({container:'body'});
			$(table).find('.ui-pg-div').tooltip({container:'body'});
		}
	
		//var selr = jQuery(grid_selector).jqGrid('getGridParam','selrow');
	
		$(document).one('ajaxloadstart.page', function(e) {
			$.jgrid.gridDestroy(grid_selector);
			$('.ui-jqdialog').remove();
		});
		
		//时间格式化
		function jsonTimeStamp(milliseconds) {
		    if (milliseconds != "" && milliseconds != null && milliseconds != "null") {
		        var datetime = new Date();
		        datetime.setTime(milliseconds);
		        var year = datetime.getFullYear();
		        var month = datetime.getMonth() + 1 < 10 ? "0"
		                + (datetime.getMonth() + 1) : datetime.getMonth() + 1;
		        var date = datetime.getDate() < 10 ? "0" + datetime.getDate()
		                : datetime.getDate();
		        var hour = datetime.getHours() < 10 ? "0" + datetime.getHours()
		                : datetime.getHours();
		        var minute = datetime.getMinutes() < 10 ? "0"
		                + datetime.getMinutes() : datetime.getMinutes();
		        var second = datetime.getSeconds() < 10 ? "0"
		                + datetime.getSeconds() : datetime.getSeconds();
		        return year + "-" + month + "-" + date + " " + hour + ":" + minute
		                + ":" + second;
		    } else {
		        return "";
		    }
		 
		}
	});
	});
</script>
<%--<script src="${contextPath}/static/system/js/common/vue.js"></script>--%>
<%--<script src="${contextPath}/static/layer/layer.js"></script>--%>
<script type="text/javascript" src="${contextPath}/static/statistics/js/jquery.mockjax.js"></script>
<script type="text/javascript" src="${contextPath}/static/statistics/js/jquery.autocomplete.js"></script>
<script type="text/javascript" src="${contextPath}/static/util/my-autocomplete.js"></script>
<script src="${contextPath}/static/statistics/js/bootstrap-datetimepicker.min.js"></script>
<script src="${contextPath}/static/statistics/js/bootstrap-datetimepicker.fr.js"></script>
<script src="${contextPath}/static/statistics/js/bootstrap-datetimepicker.zh-CN.js"></script>
<script type="text/javascript">
		/**
		 * 搜索店铺
		 */
		function searchShop() {

            var shopNameInp = $("#shopNameInp").val();
            var shopType = $("#shopType1").val();
            var state = $("#state").val();

			var filters = {
                "rules" : [
                    {
                        "field" : "state",
                        "data" : state ? state : ""
                    },{
                        "field" : "shopType",
                        "data" : shopType ? shopType : ""
                    },{
                        "field" : "shopName",
                        "data" : shopNameInp ? shopNameInp : ""
                    }
                ]
			};
			console.log(filters);
			jQuery(grid_selector).jqGrid('setGridParam', {
				postData : {
					"filters" : JSON.stringify(filters) //"{'rules' : [{'field' : 'shopName','data' : "+shopName+"},{'field' : 'state','data' : "+state+"}]}"  
				}
			}).trigger("reloadGrid");
		}

		<%--
        var cityNode, quXianNode, channelNode, empNode, custNode, shopNode = null;

        <shiro:lacksPermission name="CLOUDERPORDERSPLEMPORDER:STATISTICS">
        empNode = '#slsmanNameInput';
        channelNode = '#quDaoNameInput';
        <shiro:hasPermission name="CLOUDERPORDERSPLADMINORDER:STATISTICS">
        //cityNode = '#cityNameInput';
        quXianNode = '#quXianNameInput';
        </shiro:hasPermission>
        </shiro:lacksPermission>
        custNode = "#custNameInput"
        shopNode = "#shopNameInput"

        organization_tree('${contextPath}',cityNode, quXianNode, channelNode, empNode, custNode, shopNode);
        --%>
        $('#firstTimeInput').datetimepicker({
            language: 'zh-CN',
            weekStart: 1,
            todayBtn: 1,
            autoclose: 1,
            todayHighlight: 1,
            startView: 2,
            forceParse: 0,
            minView: 2,
            showMeridian: 1,
            format: "yyyy-mm-dd",
            //startDate:new Date(),
        });

        $('#endTimeInput').datetimepicker({
            language: 'zh-CN',
            weekStart: 1,
            todayBtn: 1,
            autoclose: 1,
            todayHighlight: 1,
            startView: 2,
            forceParse: 0,
            minView: 2,
            showMeridian: 1,
            format: "yyyy-mm-dd",
            //startDate:new Date(),
        });

        /**
         * 导出Excel
         */
        var exportExcel = function () {

            var quXianName = $("#quXianNameInput").val();
            var quDaoName = $("#quDaoNameInput").val();
            var slsmanName = $("#slsmanNameInput").val();
            var custName = $("#custNameInput").val();
            var custCode = $("#custCodeInput").val();

            var shopName = $("#shopNameInput").val();
            var phone = $("#phoneInput").val();
            var isExp = $("#isExpInput").val();
            var isAuth = $("#isAuthInput").val();

            var firstTime = $("#firstTimeInput").val();
            var endTime = $("#endTimeInput").val();



            $('#exportExcelData-quXianName').val(quXianName);
            $('#exportExcelData-channelName').val(quDaoName);
            $('#exportExcelData-empName').val(slsmanName);
            $('#exportExcelData-custName').val(custName);
            $('#exportExcelData-custCode').val(custCode);

            $('#exportExcelData-shopName').val(shopName);
            $('#exportExcelData-phone').val(phone);
            $('#exportExcelData-isExp').val(isExp);
            $('#exportExcelData-isAuth').val(isAuth);

            $('#exportExcelData-firstTime').val(firstTime);
            $('#exportExcelData-endTime').val(endTime);
           // layer.msg('已提交导出请求，请等待结果');

            $("#exportExcel").submit();

        }
</script>

<!-- 点击事件 -->
<script type="text/javascript">
	$("#examApplay").click(function () {
		queryObjects();
    })

    var addCargoShop = function () {
        //layer.load(1);
        $("#audit6Form")[0].reset();
        var title = '新增';
//        $.fn.zTree.init($("#treeDemoShop"));
        $("#authorizationInfoContentShop").removeClass("hide")
        modalIndexShop = layer.open({
            type: 1,
            title: title,
            closeBtn: 1,
            shadeClose: true,
            maxmin: true,
            area: ['650px','100%'],
            skin: 'yourclass',
            content: $("#authorizationInfoContentShop"),
            end: function () {
                $("#authorizationInfoContentShop").addClass("hide")
                $("#businessLicenseDiv").addClass("hide")
                $("#licenceDiv").addClass("hide")
                $("#smallTitle").addClass("hide")
                $("#tableDiv").removeClass("hide")
            }
        });
    }

	$("#editgoShop").click(function () {
        var id = $(grid_selector).jqGrid('getGridParam', 'selrow');
        if (!id) {
            layer.msg( "提示：请选择一条信息");
            return;
        }
        getShop(id);
        var title = '审批'; 
        $("#authorizationInfoContentShop").removeClass("hide")
        modalIndexShop = layer.open({
            type: 1,
            title: title,
            closeBtn: 1,
            shadeClose: true,
            maxmin: true,
            area: ['650px','100%'],
            skin: 'yourclass',
            content: $("#authorizationInfoContentShop"),
            end: function () {
                $("#authorizationInfoContentShop").addClass("hide")
                $("#businessLicenseDiv").addClass("hide")
                $("#licenceDiv").addClass("hide")
                $("#smallTitle").addClass("hide")
                $("#tableDiv").removeClass("hide")
            }
        });
        layer.closeAll('loading');
    })
</script>

<!-- 业务提交方法 -->
<script type="text/javascript">

	var queryModel = {};

    var queryObjects = function () {
            getObjects();
    }


    var getObjects = function () { 
    	var marketExamOpinion = $("#marketExamOpinion").val()
    	if(marketExamOpinion == "" || marketExamOpinion == null){
    		alert("请输入审批意见");
    		return;
    	}
    	var marketExamTime = $("#marketExamTime").val()
    	if(marketExamTime == "" || marketExamTime == null){
    		alert("请输入经办时间");
    		return;
    	}
    	var marketExamPerson = $("#marketExamPerson").val()
    	if(marketExamPerson == "" || marketExamPerson == null){
    		alert("请输入经办人");
    		return;
    	}
    	//var examForm = $("#examForm").serialize();
    	var examForm = $("#examForm").serializeJson();
		//var examForm = JSON.stringify(examForm);
		console.log(examForm);
        $.ajax({
            type: 'post',
            url: '${contextPath}/ktJoin/examApplay',
            data:examForm,   
            dataType: 'json',
            success: function (data) {
            	layer.msg(data.message);
            	setTimeout(function(){ 
            		layer.closeAll(); 
            	}, 1000);
            	reload();
            },
            error: function (data) {
            	layer.msg(data.message);
            	layer.closeAll('loading');
            }
        });
    };

    var reload = function () {
        $(grid_selector).jqGrid('setGridParam',{
        	url: "${contextPath}/ktJoin/getApplayInfo",
            datatype:'json',
            page:1
        }).trigger("reloadGrid"); //重新载入
    }


    var getShop = function (id) {
        var rowData = $(grid_selector).jqGrid('getRowData',id);
        console.log(rowData);
        if(rowData.BASE_OWN_SHOP == '没有'){
        	$("#shopSituations").hide();
        }else{
        	$("#shopSituations").show();
        }
        $("#audit6Form").setForm(rowData);

        /* if(rowData.imageUrl != '') {
            console.log(rowData.imageUrl)
            var imageUrl = 'http://clouderp.skystorechain.com:20080/' + rowData.imageUrl;
            $("#imageUrl").val(rowData.imageUrl)
            $("#showImageInfoImg").attr("src", imageUrl);
        } */
        /****
        var shopId = rowData.shopId;
        var filters = {
            "rules": [
                {
                    "field": "type",
                    "data": 'kt'
                },
                {
                    "field": "shopId",
                    "data": shopId
                }
            ]
        };
        var grid_data = {'filters': JSON.stringify(filters)};

        console.log(grid_data)
        $.ajax({
            url: '${contextPath}/ktProd/getShopListByPage',
			type : "get",
			data : queryModel,
			dataType : "json",
			async : true,
            success: function (data) {
                layer.closeAll('loading');
                console.log(data)
                if (data.success == false){
                    layer.msg("获取出错："+data.message)
                    return
                }
                var dataArray = data.recordList;
                $("#audit6Form").setForm(dataArray);
//                if (dataArray.length == 0){
//                    layer.msg("查询没有数据")
//                    return
//                }
                $('#myModal').modal('show');
            },
            error: function (error) {
                layer.closeAll('loading')
            }
        })
		 **/
    }

    var submitImg = function (fileStart, fruset) {
        var id = $("#id").val();

        var fileType = "";
        var imageFile = "";
        var fileStr = "";
        if (fileStart == '1'){
            fileStr = $("#fileStr").val();
            fileType = $("#fileType").val();
            imageFile = $("#image_file_input")[0].files[0];
        }else if (fileStart == '2'){
            fileStr = $("#fileStr1").val();
            fileType = $("#fileType1").val();
            imageFile = $("#image_file_input1")[0].files[0];
        }
        if (fileType == "") {
            layer.msg("提示：请选择上传图片");
            return;
        }
        queryModel.fruset = fruset;
//        if (fruset){
//            if (!id){
//                $("#smallTitle").html("提示：没有基础信息绑定");
//                $("#smallTitle").removeClass("hide");
//                return;
//            }
//        }

        if (imageFile.size > 524288) {
            layer.msg("封面图片不得大于512KB");
            $("#smallTitle").removeClass("hide");
            return
        }
        var index = fileStr.indexOf("base64,");

        if (index > 0) {
            fileStr = fileStr.substring(index + 7);
            var fileType = $("#fileType").val();
            fileType = fileType.substring(6);
            if (fileStart == '1'){
                $("#fileStr").val(fileStr);
                $("#fileType").val(fileType);
            }else if (fileStart == '2'){
                $("#fileStr1").val(fileStr);
                $("#fileType1").val(fileType);
            }
        }
        if (fileStart == '1'){
            queryModel.fileStr = $("#fileStr").val();
            queryModel.fileType = $("#fileType").val();
        }else if (fileStart == '2'){
            queryModel.fileStr = $("#fileStr").val();
            queryModel.fileType = $("#fileType").val();
        }
        queryModel.fileStart = fileStart;

        console.log(queryModel);
        //return
//        formData["text"] = $('#summernote').summernote("code");
//        formData["cloudId"] = $("#cloudlingId").val();
//        formData["firstUserId"] = $("#firstUserId").val();
//        formData["endUserId"] = $("#endUserId").val();
        // console.log(formData)
        //return
        layer.load(1);
        $.ajax({
            type: 'POST',
            url: '${contextPath}/ktPurchase/submitImg',
            data: queryModel,
            dataType: 'json',
            async : false,
            success: function (data) {
                layer.closeAll('loading');
                if (data.success == false){
                    $("#smallTitle").html(data.message);
                    return
                }
                $("#smallTitle").html(data.message);
                $("#smallTitle").removeClass("hide");
                var dataArray = data.data;
                if (fileStart == '1') {
                    queryModel.businessLicenseImage = dataArray;
                    $("#imageUrl").val(dataArray)
                }else if (fileStart == '2'){
                    queryModel.licenseImage = dataArray;
                    $("#imageUrl1").val(dataArray)
                }
                layer.msg("提示：图片上传成功");
                console.log(queryModel)
            },
            error: function (result) {
                layer.closeAll('loading');
                $("#smallTitle").html("上传失败！");
                $("#smallTitle").removeClass("hide");
            }
        });
    }

	//图片预览
    var input = document.getElementById("image_file_input");
    if (typeof(FileReader) === 'undefined') {
        alert("抱歉，你的浏览器不支持 FileReader，请使用现代浏览器操作！");
        input.setAttribute('disabled', 'disabled');
    } else {
        input.addEventListener('change', readFile, false);
    }

    function readFile() {
        $("#smallTitle").addClass("hide");
        var file = this.files[0];
        if(file == undefined) {
            //layer.msg("发送内容过大，请检查图片和内容");
            $("#showImageInfoImg").attr("src",img64);
            $("#fileStr").val("");
            $("#fileType").val("");
            return;
        }
        //这里我们判断下类型如果不是图片就返回 去掉就可以上传任意文件
        if (!/image\/\w+/.test(file.type)) {
            layer.msg("请确保文件为图像类型");
            return false;
        }
        var reader = new FileReader();
        reader.readAsDataURL(file);
        reader.onload = function (e) {
            $("#fileStr").val(this.result);
            //document.getElementById("fileStr").value = '<img src="'+this.result+'" alt=""/>';
            //img_area.innerHTML = '<div class="sitetip">图片img标签展示：</div><img src="'+this.result+'" alt=""/>';
            //alert($("#fileStr").val());
            $("#fileType").val(file.type);
            //alert(file.type);
            $("#showImageInfoImg").attr("src", this.result);
        }
    }

    var input1 = document.getElementById("image_file_input1");
    if (typeof(FileReader) === 'undefined') {
        alert("抱歉，你的浏览器不支持 FileReader，请使用现代浏览器操作！");
        input1.setAttribute('disabled', 'disabled');
    } else {
        input1.addEventListener('change', readFile1, false);
    }

    function readFile1() {

        var file = this.files[0];
        if(file == undefined) {
            //layer.msg("发送内容过大，请检查图片和内容");
            $("#showImageInfoImg1").attr("src",img64);
            $("#fileStr1").val("");
            $("#fileType1").val("");
            return;
        }
        //这里我们判断下类型如果不是图片就返回 去掉就可以上传任意文件
        if (!/image\/\w+/.test(file.type)) {
            layer.msg("请确保文件为图像类型");
            return false;
        }
        var reader = new FileReader();
        reader.readAsDataURL(file);
        reader.onload = function (e) {
            $("#fileStr1").val(this.result);
            //document.getElementById("fileStr").value = '<img src="'+this.result+'" alt=""/>';
            //img_area.innerHTML = '<div class="sitetip">图片img标签展示：</div><img src="'+this.result+'" alt=""/>';
            //alert($("#fileStr").val());
            $("#fileType1").val(file.type);
            //alert(file.type);
            $("#showImageInfoImg1").attr("src", this.result);
        }
    }

</script>

<%-- <link rel="stylesheet" href="${contextPath}/static/jeDate-test.css">
<link rel="stylesheet" href="${contextPath}/static/jedate.css">
<script src="${contextPath}/static/jedate.js"></script>
<script src="${contextPath}/static/demo.js"></script> --%>
<!-- 数型插件 -->
<script type="text/javascript">
    $("#getShopId").click(function(){
//        getShopType();
//        pageInit();
//        var id = $(grid_promotion_selector).jqGrid('getGridParam', 'selrow');
//        if (!id) {
//            $.jgrid.info_dialog( "提示：", "请选择一条角色信息");
//            return;
//        }
        layer.load(1);
        var setting = {
            check: {
//                enable: true,
//                chkStyle: "checkbox",
                //chkboxType: { "Y" : "p", "N" : "ps" }
                dblClickExpand: false,
                showLine: true,
                selectedMulti: false
            },
            data: {
                simpleData: {
                    enable: true ,
                    idKey: "id",
                    pIdKey: "parentId",
                    rootPId: null,
                }
            },
            callback: { //回调函数
                /**
                 * event:鼠标事件
                 * treeId：树的容器id
                 * treeNode：当前点击的节点
                 */
                //点击
//                beforeClick: function(treeId, treeNode) {
//                    var treeObj = $.fn.zTree.getZTreeObj("treeDemo");
//                    var node = treeObj.getSelectedNodes();//点击节点后 获取节点数据
//                    if(node.length > 0){
//                        console.log(node[0].name)
//                        $("#h").html(node[0].name)
//                    }
//
//                },
                //双击
                onDblClick: function (treeId, treeNode) {
                    var treeObj = $.fn.zTree.getZTreeObj("treeDemo");
                    var node = treeObj.getSelectedNodes();//点击节点后 获取节点数据
					$("#zoneCode").val(node[0].zoneCode);
                    $("#zoneName").val(node[0].zoneName);
                    layer.close(modalIndex);
                }
            }
        };

        var zNodes =[];

        var dataJson = {
            //分页参数
            page: '1',
            rows: '1000',
        }
        $.ajax({
            url : "${contextPath}/ktCommon/getZoneListByPage",
            type : "post",
            dataType : "json",
            data: dataJson,
            async : false,
            success : function(data) {
                layer.closeAll('loading');
                zNodes = data.recordList;
                for(var i=0;i<zNodes.length;i++){
                    zNodes[i].name = zNodes[i].zoneName;
                }
                console.log(zNodes);
                $.fn.zTree.init($("#treeDemo"), setting, zNodes);
                $("#authorizationInfoContent").removeClass("hide")
                modalIndex = layer.open({
                    type: 1,
                    title: '区域',
                    closeBtn: 1,
                    shadeClose: true,
                    maxmin: true,
                    area: ['300px', '500px'],
                    skin: 'yourclass',
                    content: $("#authorizationInfoContent"),
                    end: function () {
                        $("#authorizationInfoContent").addClass("hide")
                    }
                });

            },
            error : function () {
                layer.closeAll('loading');
                layer.msg("网络异常")
            }
        });
    })

    $("#getShopIdBtn").click(function () {
        var shopId = '';
        var ids = $(grid_shop_selector).jqGrid('getGridParam', 'selarrrow');
        console.log(ids);
        var len = ids.length;
        if(len == 0){
            layer.msg("提示：请选择店铺！");
            return;
        }
        $("#shopIds").val(ids);
        layer.close(modalIndex);
//        for(var i=0;i<len;i++){
//            var rowData = $(grid_shop_selector).jqGrid('getRowData', ids[i]);
//        }
    });
</script>

